#include "HandPokerRateTable.h"

HandPokerRateTable::HandPokerRateTable() {
}

HandPokerRateTable::~HandPokerRateTable() {
}

HandPokerRateTable * HandPokerRateTable::sharedHandPokerRateTable() {
  HandPokerRateTable * pInstance = NULL;
  if (!pInstance) {
    pInstance = new HandPokerRateTable();
    pInstance->initTable();
  }
  return pInstance;  
}

float HandPokerRateTable::getHandPokerRate(const HandPoker & handPoker) {
  string key = handPoker.toString();
  if (handPokerRate.find(key) != handPokerRate.end()) {
    return handPokerRate[key];
  }
  return 0;
}

void HandPokerRateTable::initTable() {
  handPokerRate["AA"]=84.74;
  handPokerRate["KK"]=82.01;
  handPokerRate["QQ"]=79.77;
  handPokerRate["JJ"]=77.16;
  handPokerRate["TT"]=74.76;
  handPokerRate["99"]=72.09;
  handPokerRate["88"]=69.12;
  handPokerRate["AKs"]=66.67;
  handPokerRate["77"]=66.19;
  handPokerRate["AQs"]=66.00;
  handPokerRate["AJs"]=65.11;
  handPokerRate["AK"]=64.93;
  handPokerRate["AQ"]=64.19;
  handPokerRate["ATs"]=64.04;
  handPokerRate["KQs"]=63.43;
  handPokerRate["66"]=63.30;
  handPokerRate["AJ"]=63.24;
  handPokerRate["A9s"]=62.41;
  handPokerRate["KJs"]=62.40;
  handPokerRate["AT"]=62.18;
  handPokerRate["KTs"]=61.79;
  handPokerRate["A8s"]=61.64;
  handPokerRate["KQ"]=61.15;
  handPokerRate["55"]=60.67;
  handPokerRate["A7s"]=60.61;
  handPokerRate["KJ"]=60.46;
  handPokerRate["A9"]=60.34;
  handPokerRate["QJs"]=60.21;
  handPokerRate["K9s"]=59.71;
  handPokerRate["A5s"]=59.67;
  handPokerRate["A6s"]=59.63;
  handPokerRate["KT"]=59.50;
  handPokerRate["A8"]=59.45;
  handPokerRate["QTs"]=59.39;
  handPokerRate["A4s"]=58.95;
  handPokerRate["A7"]=58.42;
  handPokerRate["K8s"]=58.34;
  handPokerRate["A3s"]=58.09;
  handPokerRate["QJ"]=57.90;
  handPokerRate["Q9s"]=57.58;
  handPokerRate["JTs"]=57.47;
  handPokerRate["44"]=57.45;
  handPokerRate["K9"]=57.41;
  handPokerRate["K7s"]=57.33;
  handPokerRate["A6"]=57.33;
  handPokerRate["A5"]=57.32;
  handPokerRate["A2s"]=57.16;
  handPokerRate["QT"]=57.12;
  handPokerRate["K6s"]=56.65;
  handPokerRate["A4"]=56.60;
  handPokerRate["Q8s"]=56.02;
  handPokerRate["J9s"]=55.79;
  handPokerRate["K8"]=55.72;
  handPokerRate["K5s"]=55.71;
  handPokerRate["A3"]=55.43;
  handPokerRate["JT"]=55.23;
  handPokerRate["Q9"]=55.02;
  handPokerRate["K4s"]=54.96;
  handPokerRate["K7"]=54.94;
  handPokerRate["A2"]=54.57;
  handPokerRate["Q7s"]=54.21;
  handPokerRate["K3s"]=54.13;
  handPokerRate["J8s"]=54.01;
  handPokerRate["33"]=53.95;
  handPokerRate["K6"]=53.94;
  handPokerRate["T9s"]=53.87;
  handPokerRate["Q6s"]=53.75;
  handPokerRate["Q8"]=53.45;
  handPokerRate["K2s"]=53.22;
  handPokerRate["J9"]=53.16;
  handPokerRate["K5"]=53.04;
  handPokerRate["Q5s"]=52.86;
  handPokerRate["T8s"]=52.27;
  handPokerRate["J7s"]=52.27;
  handPokerRate["K4"]=52.24;
  handPokerRate["Q4s"]=51.85;
  handPokerRate["Q7"]=51.60;
  handPokerRate["J8"]=51.43;
  handPokerRate["T9"]=51.35;
  handPokerRate["22"]=51.23;
  handPokerRate["K3"]=51.22;
  handPokerRate["98s"]=50.97;
  handPokerRate["Q3s"]=50.88;
  handPokerRate["Q6"]=50.85;
  handPokerRate["J6s"]=50.67;
  handPokerRate["T7s"]=50.30;
  handPokerRate["K2"]=50.24;
  handPokerRate["Q2s"]=50.01;
  handPokerRate["J5s"]=49.96;
  handPokerRate["Q5"]=49.96;
  handPokerRate["T8"]=49.75;
  handPokerRate["J7"]=49.60;
  handPokerRate["J4s"]=49.52;
  handPokerRate["T6s"]=49.11;
  handPokerRate["97s"]=49.06;
  handPokerRate["Q4"]=48.85;
  handPokerRate["J3s"]=48.46;
  handPokerRate["87s"]=48.37;
  handPokerRate["Q3"]=48.20;
  handPokerRate["98"]=48.01;
  handPokerRate["T7"]=47.86;
  handPokerRate["J6"]=47.74;
  handPokerRate["96s"]=47.60;
  handPokerRate["J2s"]=47.57;
  handPokerRate["T5s"]=47.45;
  handPokerRate["Q2"]=47.30;
  handPokerRate["J5"]=47.22;
  handPokerRate["86s"]=46.74;
  handPokerRate["T4s"]=46.55;
  handPokerRate["97"]=46.30;
  handPokerRate["J4"]=46.24;
  handPokerRate["95s"]=46.04;
  handPokerRate["T6"]=46.02;
  handPokerRate["T3s"]=45.64;
  handPokerRate["76s"]=45.54;
  handPokerRate["T2s"]=45.27;
  handPokerRate["87"]=45.13;
  handPokerRate["J3"]=45.06;
  handPokerRate["85s"]=45.04;
  handPokerRate["96"]=44.47;
  handPokerRate["J2"]=44.29;
  handPokerRate["T5"]=44.13;
  handPokerRate["94s"]=44.07;
  handPokerRate["75s"]=44.03;
  handPokerRate["T4"]=43.60;
  handPokerRate["93s"]=43.56;
  handPokerRate["65s"]=43.45;
  handPokerRate["86"]=43.12;
  handPokerRate["84s"]=43.03;
  handPokerRate["95"]=42.77;
  handPokerRate["T3"]=42.53;
  handPokerRate["92s"]=42.51;
  handPokerRate["76"]=42.37;
  handPokerRate["74s"]=42.15;
  handPokerRate["54s"]=41.94;
  handPokerRate["T2"]=41.70;
  handPokerRate["64s"]=41.54;
  handPokerRate["85"]=41.39;
  handPokerRate["83s"]=41.10;
  handPokerRate["94"]=40.84;
  handPokerRate["75"]=40.65;
  handPokerRate["82s"]=40.56;
  handPokerRate["93"]=40.20;
  handPokerRate["65"]=40.18;
  handPokerRate["73s"]=40.16;
  handPokerRate["53s"]=39.98;
  handPokerRate["63s"]=39.91;
  handPokerRate["84"]=39.72;
  handPokerRate["92"]=39.34;
  handPokerRate["43s"]=39.01;
  handPokerRate["74"]=38.59;
  handPokerRate["72s"]=38.48;
  handPokerRate["54"]=38.31;
  handPokerRate["62s"]=38.28;
  handPokerRate["64"]=38.22;
  handPokerRate["52s"]=38.15;
  handPokerRate["83"]=37.65;
  handPokerRate["42s"]=37.10;
  handPokerRate["82"]=36.96;
  handPokerRate["73"]=36.80;
  handPokerRate["53"]=36.40;
  handPokerRate["63"]=36.34;
  handPokerRate["32s"]=35.92;
  handPokerRate["43"]=35.38;
  handPokerRate["72"]=34.92;
  handPokerRate["52"]=34.61;
  handPokerRate["62"]=34.45;
  handPokerRate["42"]=33.51;
  handPokerRate["32"]=32.64;
}
